from django.db import models
from users.models import User

class Dorm(models.Model):
    dorm_number = models.CharField(max_length=10, unique=True)
    capacity = models.IntegerField()
    occupied = models.IntegerField(default=0)

class DormAssignment(models.Model):
    student = models.ForeignKey(User, on_delete=models.CASCADE)
    dorm = models.ForeignKey(Dorm, on_delete=models.CASCADE)
    assigned_date = models.DateField(auto_now_add=True)